/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.loja.view.component.factory;

import br.com.loja.util.reflection.ReflectionUtil;
import java.awt.Component;
import java.util.Calendar;

/**
 *
 * @author DavidLuiz
 */
public abstract class ComponentFactory {

    private final Class<?> classType;

    public ComponentFactory(Class<?> classType) {
        this.classType = classType;
    }

    public Class<?> getClassType() {
        return classType;
    }

    public abstract Component getComponent();

    public boolean isBoolean() {
        return Boolean.class.isAssignableFrom(getClassType());
    }

    public boolean isCalendar() {
        return Calendar.class.isAssignableFrom(getClassType());
    }

    public boolean isEntity() {
        return ReflectionUtil.isEntity(getClassType());
    }

    public boolean isEnum() {
        return getClassType().isEnum();
    }

}
